package com.bf.hotpoint.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.geo.Point;
import org.springframework.stereotype.Service;

import com.bf.hotpoint.dao.TestDao;
import com.bf.hotpoint.domain.TestObject;
import com.bf.hotpoint.repository.redis.TestRedis;
import com.bf.hotpoint.service.TestService;

@Service
public class TestServiceImpl implements TestService{

	@Autowired
	private TestDao testDao;
	
	@Autowired
	private TestRedis repository;
	
	public void addToHash(String id,int age,String name)
	{
		TestObject to = new TestObject();
		to.setAge(age);
		to.setName(name);
		to.setLocation(new Point(11, 11));
		repository.addTestObjectToHash(id, to);
	}
	
	public void addLink(String name)
	{
		repository.addLink(name);
	}
	
	public void addToSet(int age,String name)
	{
		TestObject to = new TestObject();
		to.setAge(age);
		to.setName(name);
		to.setLocation(new Point(11, 11));
		repository.addTestObjectToSet(to);
	}
	
	public void useCallback() {
		repository.useCallback();
	}
	
	public void invokService() {
		System.out.println("______________service________________");
		testDao.invokDao();	
	}
	
	/*@Scheduled(fixedRate=5000)*/
	public void testTimer(){
		System.out.println("test timer");	
	}
	
	
	public void testTimer2(){
		System.out.println("test timer2");	
	}
}
